package zju.dgm.util;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import zju.dgm.dto.ServerInfo;

import java.util.concurrent.*;

/**
 * 同步当前集群的状态
 */
@Configuration
public class SyncUtil {

    public static volatile String serverName = null;

    public static volatile ServerInfo serverInfo;

    public static volatile String masterName = "";

    public static ConcurrentHashMap<String, ServerInfo> serverInfoMap = new ConcurrentHashMap<>();

    public static ThreadPoolExecutor tpe = new ThreadPoolExecutor(
            15, Integer.MAX_VALUE, 1, TimeUnit.MINUTES,
            new LinkedBlockingDeque<>()
    );


}
